/*
 * @Author: zwz
 * @Date: 2023-05-27 14:30:26
 * @LastEditors: zwz
 * @LastEditTime: 2023-06-06 11:08:54
 * @Description: 上下文
 */

module.exports = {
    params(key) {
      const method = this.request.method
      if (method === 'GET') {
        return key ? this.query[key] : this.query
      } else {
        return key ? this.request.body[key] : this.request.body
      }
    },
    success(msg,data,code) {
        this.body = {
            msg,
            data:data,
            code
        };
    },
    failure(msg,data,code) {
        this.body = {
            msg,
            data:data,
            code
        };
    },
}